import led from '../api/led';
const app = getApp();

Page({
  data: {   
    isOn: false,
  },
  onLoad() {
    this.data.isOn = false
    led.turnOffLed()
  },

  goToDelayWxml(){
    wx.redirectTo({
      url: '../delayControl/delayControl',
    })
  },
  turnOnLed(){
    if(led.isRepeatTurnOn(this.data.isOn)){
      return;
    }
    this.data.isOn = true;
    led.turnOnLed();
  },
  turnOffLed(){
    if(led.isRepeatTurnOff(this.data.isOn)){
      return;
    }
    this.data.isOn = false;
    led.turnOffLed();
  },
})